package net.NingXiaRuiTai.ShortChain.controller;


import net.NingXiaRuiTai.ShortChain.model.VO.DomainVO;
import net.NingXiaRuiTai.ShortChain.service.DomainService;
import net.NingXiaRuiTai.ShortChain.utils.JsonData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Yuan
 * @since 2025-02-23
 */
@RestController
@RequestMapping("/api/domain/v1")
public class DomainController {
    @Resource
    private DomainService domainService;

    /**
     * 列举全部域名
     * @return JsonData
     */
    @GetMapping("/list")
    public JsonData listAll(){
        List<DomainVO> list=domainService.listAll();
        return JsonData.buildSuccess(list);

    }

}

